<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>0元购</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <style media="screen">
        html,
        body {
            background-color: #CC0004;
        }

        .wrap {
            width: 100%;
            padding: 0 9px;
            box-sizing: border-box;
            overflow: hidden;
        }

        .zero_buy_bg {
            width: 100%;
            height: 348px;
        }

        .zero_buy_bg img {
            display: block;
            width: 100%;
            height: 100%;
        }

        .step {
            width: 100%;
            padding: 12px;
            box-sizing: border-box;
            overflow: hidden;
        }

        .setp_inner {
            width: 100%;
            padding: 10px;
            background: #FA5757;
            border-radius: 10px;
        }

        .content {
            width: 100%;
            /*overflow: hidden;*/
            position: relative;
            padding-top: 15px;
            padding-bottom: 15px;
            border-radius: 10px;
            background-color: #fff;
        }

        .content .activity_rules {
            width: 73px;
            height: 21px;
            text-align: center;
            background: linear-gradient(-79deg, #F6B152, #EE7139);
            border-radius: 0px 10px 10px 0px;
            font-size: 12px;
            font-family: PingFang SC;
            font-weight: bold;
            color: #FFFFFF;
            line-height: 21px;
            position: absolute;
            left: 0;
            top: 13px;
        }

        .content .title {
            width: 100%;
            height: 17px;
            font-size: 16px;
            font-family: PingFang SC;
            font-weight: bold;
            color: #333333;
            line-height: 17px;
            text-align: center;
        }

        .content_setp {
            width: 100%;
            padding: 0 30px;
            display: flex;
            justify-content: space-between;
            box-sizing: border-box;
            margin-top: 20px;
        }

        .content_setp div.icon {}

        .content_setp div.icon span {
            display: block;
        }

        .content_setp div.icon span:first-child {
            width: 40px;
            height: 40px;
            margin: 0 auto;
        }

        .content_setp div.icon span:first-child img {
            width: 40px;
            height: 40px;
            display: block;
        }

        .content_setp div.icon span:last-child {
            width: 100%;
            height: 13px;
            font-size: 12px;
            font-family: PingFang SC;
            font-weight: bold;
            color: #333333;
            line-height: 13px;
            margin-top: 15px;
            text-align: center;
        }

        .content_setp div.line {
            width: 20.5px;
            height: 13.5px;
            background: url(../../image/zero_buy_arrow.png) no-repeat;
            background-size: 100% 100%;
            margin-top: 13px;
        }

        .dataList {
            width: 100%;
            margin-top: 25.5px;
            overflow: hidden;
        }

        .dataList>.title {
            width: 100%;
            padding: 0 15px;
            box-sizing: border-box;
            overflow: hidden;
            display: flex;
            justify-content: space-between;
        }

        .dataList .title span.line {
            width: 25px;
            height: 1px;
            background-color: #fff;
            margin-top: 8px;
        }

        .dataList .title span.text {
            width: auto;
            height: 17px;
            font-size: 16px;
            font-family: PingFang SC;
            font-weight: 400;
            color: #FFFFFF;
            line-height: 17px;
        }

        .guess_love {
            width: 100%;
            overflow: hidden;
            padding: 0 15px;
            margin-top: 16.5px;
            box-sizing: border-box;
            border-radius: 10px;
            background-color: #fff;
            margin-bottom: 16.5px;
        }

        .guess_love>.title {
            width: 100%;
            overflow: hidden;
            display: flex;
            padding: 0 110px;
            box-sizing: border-box;
            justify-content: space-between;
        }

        .guess_love .title div.line {
            width: 17px;
            height: 1px;
            background: #FF4141;
            margin-top: 7px;
        }

        .guess_love .title div.text {
            height: 15;
            line-height: 15px;
            font-size: 14px;
            font-family: PingFang SC;
            font-weight: 500;
            color: #FF4141;
            flex: 1;
            text-align: center;
        }

        .guess_love ul {
            width: 100%;
            padding: 10px 0;
            overflow: hidden;
        }

        .guess_love ul li {
            width: 100%;
            overflow: hidden;
            display: flex;
            justify-content: space-between;
            padding: 10px 10px;
            border: none;
            background-size: 100% 1px;
            background-repeat: no-repeat;
            background-position: bottom;
            background-image: linear-gradient(0, #EEEEEE, #EEEEEE 50%, transparent 50%);
            background-image: -webkit-linear-gradient(90deg, #EEEEEE, #EEEEEE 50%, transparent 50%);
        }

        .guess_love ul li div.shop_picture {
            width: 100px;
            height: 100px;
            background: red;
            border-radius: 5px;
        }

        .guess_love ul li div.shop_picture img {
            display: block;
            width: 100%;
            height: 100%;
            border-radius: 5px;
        }

        .guess_love ul li div.shop_info {
            flex: 1;
            padding-left: 6px;
            min-width: 0;
            box-sizing: border-box;
            position: relative;
        }

        .guess_love ul li div.shop_info div.title {
            display: flex;
        }

        .guess_love ul li div.shop_info div.title span:first-child {
            width: 25px;
            height: 12px;
            margin-top: 0.5px;
        }

        .guess_love ul li div.shop_info div.title span:first-child img {
            display: block;
            width: 100%;
            height: 100%;
        }

        .guess_love ul li div.shop_info div.title span:last-child {
            width: auto;
            max-width: 202px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            height: 13px;
            line-height: 13px;
            font-size: 12px;
            font-weight: bolder;
        }

        .guess_love ul li div.shop_info div.price {
            display: flex;
            margin-top: 18px;
        }

        .guess_love ul li div.shop_info div.price span {
            height: 13px;
            line-height: 13px;
            font-size: 12px;
        }

        .guess_love ul li div.shop_info div.price span:last-child {
            color: #FF4141;
        }

        .guess_love ul li div.shop_info div.price span:first-child {
            color: #333333;
            font-size: 10px;
            line-height: 14px;
            font-weight: bolder;
        }

        .guess_love ul li div.shop_info div.price span:nth-child(2) {
            color: #666666;
            font-size: 10px;
            line-height: 14px;
        }

        .guess_love ul li div.shop_info div.coupons {
            display: flex;
            margin-top: 17px;
        }

        .guess_love ul li div.shop_info div.coupons span:first-child {
            width: 50px;
            height: 15px;
            background: #FFE3E3;
            font-size: 10px;
            font-family: PingFang SC;
            font-weight: 500;
            color: #FF4141;
            text-align: center;
            line-height: 15px;
        }

        .guess_love ul li div.shop_info div.coupons span:last-child {
            width: 50px;
            height: 15px;
            background: linear-gradient(-90deg, #7519EB, #A329F3);
            border-radius: 2.5px;
            font-size: 10px;
            font-family: PingFang SC;
            font-weight: 500;
            color: #fff;
            text-align: center;
            line-height: 15px;
            margin-left: 4px;
        }

        .guess_love ul li div.shop_info div.sold {
            width: auto;
            height: 12px;
            border-radius: 2.5px;
            font-size: 12px;
            font-family: PingFang SC;
            font-weight: 500;
            color: #FF4242;
            /*text-align: center;*/
            line-height: 12px;
            margin-top: 13px;
        }

        .guess_love ul li div.shop_info div.name {
            width: auto;
            height: 12px;
            border-radius: 2.5px;
            font-family: PingFang SC;
            font-weight: 500;
            /*text-align: center;*/
            line-height: 12px;
            margin-top: 11px;
        }

        .guess_love ul li div.shop_info div.name a {
            text-decoration: line-through;
            color: #999999;
            font-size: 10px;
        }

        .instanceQ {
            width: 73px;
            height: 28px;
            background: linear-gradient(-79deg, #F6B152, #EE7139);
            border-radius: 14px;
            font-size: 12px;
            font-family: PingFang SC;
            font-weight: 400;
            color: #FFFFFF;
            line-height: 28px;
            text-align: center;
            position: absolute;
            right: 0;
            bottom: 0;
        }

        [v-cloak] {
            display: none!important;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak>
        <div class="wrap">
            <div class="zero_buy_bg"><img src="../../image/zero_buy_bg.png" alt=""></div>
            <div class="step">
                <div class="setp_inner">
                    <div class="content">
                        <div class="title">补贴返款 流程3步骤</div>
                        <div class="activity_rules" @click='openActivityRulesPage()'>活动规则</div>
                        <div class="content_setp">
                            <div class="icon">
                                <span><img src="../../image/zero_buy_cart.png" alt=""></span>
                                <span>购买下单</span>
                            </div>
                            <div class="line"></div>
                            <div class="icon">
                                <span><img src="../../image/zero_buy_yz.png" alt=""></span>
                                <span>验证下单</span>
                            </div>
                            <div class="line"></div>
                            <div class="icon">
                                <span><img src="../../image/zero_buy_qb.png" alt=""></span>
                                <span>补贴返款</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>


            <div class="dataList">
                <div class="title">
                    <span class="line"></span>
                    <span class="text">每日福利购  新人抢免单</span>
                    <span class="line"></span>
                </div>

                <div class="guess_love" style="padding:0;">
                    <ul>
                        <li v-for='item in dataList' @click='openGoodsDtailsPage(item.goodsId)'>
                            <div class="shop_picture">
                                <img :src="item.mainPic" alt="">
                            </div>
                            <div class="shop_info">
                                <div class="title"><span><img src="../../image/tm.png" alt=""></span><span>{{item.dtitle}}</span></div>
                                <div class="coupons"><span>{{item.couponPrice}}元券</span><span>补贴{{item.actualPrice}}元</span></div>
                                <div class="sold">补贴后¥0元</div>
                                <div class="name"><a>原价{{item.originalPrice}}</a></div>
                                <div class="instanceQ">立即抢</div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/vue.js"></script>
<script type="text/javascript" src="../../script/cling.js"></script>
<script type="text/javascript">
    apiready = function() {
        vm.initRefresh();
        vm.bottomLoad();
        vm.init()
    }
    var vm = new Vue({
        el: '#app',
        data: {
            offset:0,
            dataList:[]
        },
        methods: {
            init: function(isClick) {
                if (isClick) {
                    vm.offset += 10;
                } else { // 下拉刷新 或者 初次加载
                    vm.offset = 0;
                }
                api.ajax({
                    url: cl.apiServer + 'zeroBuyOrder/getZeroGoods',
                    method: 'post',
                    headers: {
                        'Content-Type': 'application/json;charset=utf-8',
                        token:cl.userToken
                    },
                    data: {
                        body: {
                            limit:10,
                            offset:vm.offset,
                            type:1,
                            version:cl.deviceInfo().appVersion,
                            mobileInfo:cl.systemType()
                        }
                    }
                }, function(ret, err) {
                    if (ret) {
                      //  alert(JSON.stringify(ret))
                       if (ret.code == 0) {
                           if (ret.data.length >= 10) {
                               vm.no_more = false;
                               vm.dataList = vm.dataList.concat(ret.data);
                           } else if (ret.data.length == 0) {
                               vm.no_more = true;
                           }else{
                               vm.dataList = vm.dataList.concat(ret.data);
                           }

                       }
                    }
                })
            },
            //下拉刷新
            initRefresh: function() {
                cl.openRefresh(function() {
                    vm.init()
                })
            },
            //上拉加载
            bottomLoad: function() {
                cl.scrollBottom(function() {
                    vm.init(true)

                })
            },
            openGoodsDtailsPage: function(id) {
                console.log(id);
                cl.openWin({
                    name: 'goods_deatils',
                    pageParam: {
                        id: id
                    }
                })
            },
            openActivityRulesPage:function(){
              cl.openWin({
                  name: '../mine/activity_rule'
              })
            }
        }
    });
</script>

</html>
